using System;
using System.Collections.Generic;
using Nop.Core.Domain.Orders;

namespace Nop.Core.Domain.Shipping
{
    /// <summary>
    /// Represents a shipment
    /// </summary>
    public partial class Shipment : BaseEntity
    {
        private ICollection<ShipmentOrderProductVariant> _shipmentOrderProductVariants;

        /// <summary>
        /// Gets or sets the order identifier
        /// </summary>
        public int OrderId { get; set; }
        
        /// <summary>
        /// Gets or sets the tracking number of this shipment
        /// </summary>
        public string TrackingNumber { get; set; }

        /// <summary>
        /// Gets or sets the total weight of this shipment
        /// It's nullable for compatibility with the previous version of nopCommerce where was no such property
        /// </summary>
        public decimal? TotalWeight { get; set; }

        /// <summary>
        /// Gets or sets the length of the shipment package.
        /// </summary>
        public decimal? Length { get; set; }

        /// <summary>
        /// Gets or sets the width of the shipment package.
        /// </summary>
        public decimal? Width { get; set; }

        /// <summary>
        /// Gets or sets the height of the shipment package.
        /// </summary>
        public decimal? Height { get; set; }

        /// <summary>
        /// Gets or set the package identifier which bound to the current shipment 
        /// </summary>
        public int? PackageId { get; set; }

        /// <summary>
        /// null or 0 means nothing. 1 means it is fragile
        /// TODO: Make this enum
        /// </summary>
        public int? Attributes { get; set; }

        /// <summary>
        /// Gets or sets the insurance value
        /// </summary>
        public decimal? InsuranceValue { get; set; }

        /// <summary>
        /// Comments of the shipment
        /// </summary>
        public string Comment { get; set; }

        /// <summary>
        /// Different package sizes of shipment
        /// </summary>
        public int SpotshubPackageSize { get; set; }

        /// <summary>
        /// Gets or sets the shipped date and time
        /// </summary>
        public DateTime? ShippedDateUtc { get; set; }

        /// <summary>
        /// Gets or sets the delivery date and time
        /// </summary>
        public DateTime? DeliveryDateUtc { get; set; }

        /// <summary>
        /// Gets or sets the entity creation date
        /// </summary>
        public DateTime CreatedOnUtc { get; set; }

        /// <summary>
        /// Gets the order
        /// </summary>
        public virtual Order Order { get; set; }

        /// <summary>
        /// Gets or sets the shipment order product variants
        /// </summary>
        public virtual ICollection<ShipmentOrderProductVariant> ShipmentOrderProductVariants
        {
            get { return _shipmentOrderProductVariants ?? (_shipmentOrderProductVariants = new List<ShipmentOrderProductVariant>()); }
            protected set { _shipmentOrderProductVariants = value; }
        }
    }
}